package com.cgwx.commonutils.math.function;

/**
 * @author GaoWei
 * @Date 2021/8/6 - 9:46
 */
public class AtanhFunction implements Function
{
    @Override
    public double of(double[] d, int numParam)
    {
        return (Math.log(1.0D + d[0]) - Math.log(1.0D - d[0])) / 2.0D;
    }

    @Override
    public boolean acceptNumParam(int numParam)
    {
        return numParam == 1;
    }

    public String toString()
    {
        return "atanh(x)";
    }
}
